I have a table created in a Select Statement that is sent in an Email. In the value field of the table, I am formatting as an href with an expression in the middle: <a href = item()?['Recap_x0020_Picture']>Pic</a>
Sometimes that field in SharePoint is left blank. But the href tag will obviously show up regardless of whether there is data or not. I'm wanting to see if there is a way to leave that field in the table blank if there is no data, so as to not have users click on links that do not go anywhere.
Solved! Go to Solution.
For the picture property, you want to use an expression.
For value2 mapping above, the expression would be something like:
if(empty(item()['Value']),'', concat('<a href="', item()['Value'], '">Pic</a>'))
If the item()['Value'] is empty, return an empty string, else construct a HREF tag.
Note: The concat function will return data for value2 looking like:
However, it should be rendered correctly as HTML:
Your expression would look similar to:
if(empty(item()['Recap_x0020_Picture']),'', concat('<a href="', item()['Recap_x0020_Picture'], '">Pic</a>'))
Ellis
For the picture property, you want to use an expression.
For value2 mapping above, the expression would be something like:
if(empty(item()['Value']),'', concat('<a href="', item()['Value'], '">Pic</a>'))
If the item()['Value'] is empty, return an empty string, else construct a HREF tag.
Note: The concat function will return data for value2 looking like:
However, it should be rendered correctly as HTML:
Your expression would look similar to:
if(empty(item()['Recap_x0020_Picture']),'', concat('<a href="', item()['Recap_x0020_Picture'], '">Pic</a>'))
Ellis