Jump to content
  • 0

Passed parameter based on a condition


Kuroshi

Question

I need to pass a parameter on the website link but with condition. For example if field1 = a then pass parameter name=[@fieldname] otherwise it will be just the link. I tried Case When statement and use the a href with the link but it is not working if it has a parameter included in the link. Do you have any other ideas for this guys?
 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @Batchini,

It might be having an issue with the quotation mark on the a href value. What you can do is to add a Virtual field that will display the link and paste the code below:
 

CASE WHEN [@field:FieldName] = '1'
THEN '<a href=' + '"' + 'https://nameofyoursite.html' + '?name=[@field:name]'>Link1</a>'
ELSE
'<a href='https://nameofyoursite.html'>Link2</a>'
END


I hope this works.

- Barbie

Link to comment
Share on other sites

  • 0

depending on what datapage you are using, you can also seperate the calculated field to the actual link.

for example, on your html block, you have this 
<a href='https://nameofyoursite.html?testparam=[@calcfield1]'>Link2</a>

then on your calculated filed, create a basic conditional statement

case when [@field:FieldName] = '1' then 1

end

On this case, the parameter will only has a value if the conditions are correct. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...