Trying to figure out how to do my own "Fav" button toggle on a Form

From a simple list, I tap on an item and display a detail page.
I have a simple “heart” icon to indicate “Favorite” status for this item.

I’m unsure of the logic to toggle the heart icon to “filled” instead of “outline” (obviously, I know I’m displaying two different icons based on a field value).
I plan to have the user Tap on the heart icon on the form.

I have a FavToggle endpoint which accepts my AuthToken and the ItemID to toggle. Database gets updated correctly, I just don’t know what my reply is supposed to be.

MY Q IS What is supposed to be returned by my FavToggle endpoint?
… and then what do I do to update the screen so the icon changes?

Since I was on an “Item” display page, do I return the entire Item record again as the result (item record includes a field for FavoriteYN? Or can I just return a true/false for the current FavButton status for that item?

I may be missing something, but how about simply having a formula pointing to two different image paths depending on the value of your FavToggle?

Once the dBase is updated, you don´t need to read it to see what there - you just wrote it. So just swap the icon. Or you can have two icons and toggle both their visibilities.

No, you’re not missing something - I was. Thx for the reply.
Yes, what you say is simple and obvious.
If I have a bit operator for the favorite flag, I just NOT() that and I don’t need to reread the database. (Just need the screen to refresh my icon formula)
Yes, I was trying to complicate it. Still a noob in AG. Thx again.

1 Like