cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vidarv
Helper I
Helper I

Select right item from gallery list

Hi,

When selecting an Item from a Gallery list I am trying to set the value as solved by selecting it, but the lookup does not find the right item. This is from onselect.

Set(varRecord,
    With({_add: "***" & CountRows(NoteGallery.AllItems) + 1 & " - " & User().FullName & " - " & Text( Now(),DateTimeFormat.LongDateTime24,"nb-NO" ) &
            ":<br>The Item is solved " &"<br>"},
           
        Patch(
            MessageCenterOrg,
            LookUp(MessageCenterOrg, ID=varRecord.ID),
            {Notes: varRecord.Notes & _add,
             Done: varRecord.Done = "" & _add
            }
            
        )
    )
);

If I  first pick the Item and send it to a different screen with 
onselect. It works

Set(varRecord , ThisItem);Navigate(MesageCenter);

 Can someone please help me ?

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @vidarv 

 

Will you consider changing the code to something like this for the Onselect of the gallery

With(
    {
        _someVariable: CountRows(yourGallery.AllItems),
        _AnotherVariable: "something here"
    }, 
    Patch(
        yourDataSource,
        ThisItem,
        {
            Notes: _SomeVariable,
            Done: _AnotherVariable
        }
    )
)

 

Result, when you click on the row that item is updated

Peek 2022-03-08 21-59.gif

 

Hope it helps ,

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

2 REPLIES 2
rubin_boer
Super User
Super User

hi @vidarv 

 

Will you consider changing the code to something like this for the Onselect of the gallery

With(
    {
        _someVariable: CountRows(yourGallery.AllItems),
        _AnotherVariable: "something here"
    }, 
    Patch(
        yourDataSource,
        ThisItem,
        {
            Notes: _SomeVariable,
            Done: _AnotherVariable
        }
    )
)

 

Result, when you click on the row that item is updated

Peek 2022-03-08 21-59.gif

 

Hope it helps ,

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
vidarv
Helper I
Helper I

Thank you @rubin_boer it works !

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (6,002)