Hello All,
I bet 50% of posts are help me, I've spent "X" hours on this, I'm desperate...
"Please, I need help, I've spent almost 2 weeks on this. I'm desperate!!
Have a Contact directory app. User filters contacts based on City, then can view/Edit an existing contact. They can also add a new contact to the city. Deleting is the part where I'm stuck. If they delete a record, the other ones need to move up one (a.k.a. be promoted in priority). I either get circular error, or "incompatible comparison" errors (ex: cannot compare a record to text).
Objective: If the "varSelectedRecord" is equal to the last record in the gallery, Remove "varSelectedRecord", else Remove"varSelectedRecord" AND re-order the "Priority", a number stored as text(1,2,3...), for the remaining records in the gallery.
If(Last(GalleryT)) = varSelectedT.selected, Remove(GalleryT, Last(GalleryT)), Remove(varSelectedT, varSelectedT.Selected) && ForAll(GalleryT, Sum(gallery.priority - 1))
I also tried using this with a collection called, "colT", but I ended up in the same place, here 🙂
I was building this formula into a Button control in the "OnSelect" property. I created a pop-up, so when the user confirms "delete" this IF statement would be executed.
The data in coming from a SharePoint, so if this is not possible, then I'm open to other suggestions. Hopefully, I'll be able to use Dataverse, soon. I started out with a Choice field in the form and was trying to filter out "Priority" that were existing, but the choice field could not be evaluated in everything I've tried. I still very much consider myself a newbie at all of this. There are not a lot of records, only 3 contacts per city, so delegation is not an issue I can see.
Thank you, again!