Monday 14 March 2022

PowerApps - linking the Gallery Arrow to a DispForm / Editform

I WAS BUILDING a gallery linked to SharePoint in a Canvas App, and ran into a spot of bother.

It's that arrow on the right that was giving me grief.

It was really easy to create a Title in the Gallery that linked back to the relevant item in the SharePoint list. I just used an HTML field and a concatenate expression, like this:

Concatenate(

     "<b><a href='https://MySite.sharepoint.com/sites/EO-IT/Lists/CaTS%20Calendar/DispForm.aspx?ID=",

     ThisItem.ID,

     "' style='text-decoration:None;'>",

     ThisItem.Title,

     "</a></b>"

)

But you see that pesky arrow on the right side of the Gallery Item? Well, I struggled with the syntax to make that link to the same item in the SP list. I tried several variations on what I thought would work in the item's OnSelect control and kept drawing a blank.

Finally, I tried this simple formula:

Launch(Concatenate("https://MySite.sharepoint.com/sites/EO-IT/Lists/CaTS%20Calendar/DispForm.aspx?ID=",ThisItem.ID))

… and to my surprise it worked. The reason I was surprised is that I’m fairly sure that this was the first formula I tried and that PowerApps threw an error.

So in case anyone else experiences the same glitch, I can confirm that the above is the correct syntax.

Hope that helps someone.