cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Super User
Super User

How to get values out of nested galleries?

I have a situation where I have a gallery in a gallery.  I need to pull data from the sub-gallery in a ForAll().  It does not seem to be giving me the correct data.  I think this is enough to get the idea across.  Perhaps there is a better way to do this?

 

 

 

 

ForAll(Gallery4.AllItems As ThisGall,
       With({ThisGall8:Gallery8.Selected},
       UpdateIf(SN_RMA_Notes,Index=ThisGall.Index,
                If(CheckValid.Text="0",{CheckValue:99},
                     If(CheckValid.Text="1",
                          {CheckValue:1,
                           Line_No:ThisGall8.LineNumber,
                           Company:If(First(Gallery8.AllItems).CustomerName<>Trim(ThisGall.Company),ThisGall8.CustomerName),
                           Acctivate:1
                                       }
                
                     )
                )
      )
))

 

 

 

 

martinav_0-1657562535859.png

Gallery8 is a result of a lookup (one record) from a thisitem.index from Gallery4.  I cannot get any of the values out of gallery8 when I do the updateif().  Values do post, but they are wrong.

 

Edited:  I should also add...  Visually, the data is correct looking at the galleries on screen.  Its only wrong when applying the ForAll() statement.

12 REPLIES 12
martinav
Super User
Super User

@Anonymous 

 

That works for Patch() and Collect() for NEW records only.  Not updating.  Unless something has changed.  How do you associate each record in the collection to the existing records with Patch() in the sqltable?  I'm not sure just placing a primary key in the table will do it.  Can you confirm you have done this to update existing records?

Anonymous
Not applicable

@martinav 
I can confirm I have done this with updating existing records. What it will not do though is delete records. So if your local collection has a record removed, it won't sync that and remove it from the source when you patch. If you patch a collection to a data source it will be one call and update the source. Much better than a ForAll.

martinav
Super User
Super User

@Anonymous 

I will verify with two records and get back with you.

 

I was in this deep quite a while ago, and Patch wouldnt do it that way.

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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

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

Top Solution Authors
Top Kudoed Authors
Users online (4,064)