Page 1 of 1

How do i insert a database value within a string in designer

Posted: Sun May 11, 2014 3:15 am
by dasdee
Hi,
How do i replace part of a text with a value from a data source. I am trying to replace a part of a text/string with a value from a datasource. I want to use IIF to check whether the user has a picture, if no, i show the default picture if yes i show the user picture by replacing or appending the user id(picture name) within the file path. Example below:

{IIF((DataSource1.PIC_STATUS ==1),"/abcde/files/pictures/"DataSource1.User_ID".jpeg", "/abcde/files/icons/default_picture.jpeg")}

Re: How do i insert a database value within a string in desi

Posted: Mon May 12, 2014 10:06 am
by HighAley
Hello.

Please, try to use next expression:

Code: Select all

{IIF((DataSource1.PIC_STATUS ==1),"/abcde/files/pictures/"+DataSource1.User_ID+".jpeg", "/abcde/files/icons/default_picture.jpeg")}
Thank you.

Re: How do i insert a database value within a string in desi

Posted: Mon May 12, 2014 11:40 am
by dasdee
Hi,
thanks a lot, it works perfectly as i wanted.
Regards.

Re: How do i insert a database value within a string in desi

Posted: Tue May 13, 2014 6:12 am
by Andrew
Great! Thank you for letting us know about this.