cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akbarmahfuzalam
Post Prodigy
Post Prodigy

Patch Gallery to SharePoint List

Hi Team,

 

I want to know what needs to be done or change in the formula below wherein I want the user to submit the button and the gallery gets empty one by one where there is an entry(If(!IsBlank(AHTReason.Text),).

But as of now, it's not happening though it submits the data to SharePoint List.

 

Concurrent(
Notify("Submitting your records...",NotificationType.Information),
ForAll(AHTBULKGallery.AllItems,
If(!IsBlank(AHTReason.Text),
Patch(
AHTException,Defaults(AHTException),
{Shiftdate:AHTSHIFTDATE.Text,Enterprise_ID:AHTEID.Text,LOB:AHTLOB.Text,Queue:AHTQueue.Text,Reason:AHTReason.Text,'Requested By':AHTTLs.Text,'Approved By':AHTOPSLEAD.Text,'Uploaded By':AHTUploadeBy.Text}
))));

Notify("All records has been submitted successfully!",NotificationType.Success);
Set(gvReset,true);Set(gvReset,false)

 

 

32 REPLIES 32

@akbarmahfuzalam ,

That is the simplest collection possible - if WHOSWHO is a list, the collection has to work. Can you please confirm this is a list - also put the same code on a button and see what you get.

Obviously the Filter will not show anything unless there is data in the collection.

 

 

 

 

 

@WarrenBelz 

 

WHOSWHO is a Sharepoint List

 

akbarmahfuzalam_0-1599248211464.png

akbarmahfuzalam_1-1599248236129.png

 

When putting the same collection on the button it shows data

akbarmahfuzalam_2-1599248492050.png

 

akbarmahfuzalam_3-1599248517662.png

 

And Since the collection has been created by the button. When I filter it out with Team Lead Dropdown, Its started giving me Value inside the Gallery but when submitting It is talking all the entry from the Gallery whereas it should only take the one which has an entry( or the one user has put some comment on the AHTReason) And do I need to use the button every time to click to generate the collection. Because without pressing the button which I just created for the sake of creating a collection.

 

When Submit all the value (rows ) went by and it is blank

 

akbarmahfuzalam_0-1599249043328.png

 

The entry is taking only the one which has value as text in the AHTReason but it should allow being visible the one which is blank or no value.

 

@akbarmahfuzalam ,

The code in both places (add and remove) specifically states something has to be in AHTReason

!IsBlank(AHTReason.Text),

so it should patch and remove matching entries.

 

@WarrenBelz 

 

I did that as well. Even though it's submitting only where it has value - IsBlank(AHTReason.Text) but clear all the rows from the Gallery

 

akbarmahfuzalam_0-1599255278301.png

 And the Collection part is not working as well. It triggers only when I click the button

@akbarmahfuzalam ,

 

!IsBlank(AHTReason.Text)

Not IsBlank

 

Where is the collection not triggering from?

 

 

@WarrenBelz 

 

I would appreciate it if you could see where I am missing the code

 

Notify("Submitting your records...",NotificationType.Information);
ForAll(
AHTBULKGallery.AllItems,
If(
!IsBlank(AHTReason.Text),
Patch(
AHTException,
Defaults(AHTException),
{
Shiftdate:AHTSHIFTDATE.Text,
Enterprise_ID:AHTEID.Text,
LOB:AHTLOB.Text,
Queue:AHTQueue.Text,
Reason:AHTReason.Text,
'Requested By':AHTTLs.Text,
'Uploaded By':AHTUploadeBy.Text
}
)
)
);
RemoveIf(
colWhosWho,
!IsBlank(AHTReason.Text)
);
Notify("All records has been submitted successfully!",NotificationType.Success);
Set(gvReset,true);
Set(gvReset,false)

 

 

 

And Collection is working now.

@akbarmahfuzalam ,

There is nothing missing, but try this

Notify("Submitting your records...",NotificationType.Information);
ForAll(
   AHTBULKGallery.AllItems As AHT,
   If(
      !IsBlank(AHT.Reason),
      Patch(
         AHTException,
         Defaults(AHTException),
         {
            Shiftdate:AHT.ShiftDate,
            Enterprise_ID:AHT.Enterprise_ID,
            LOB:AHT.LOB,
            Queue:AHT.Queue,
            Reason:AHT.Reason,
            'Requested By':AHTTLs.Text,
            'Approved By':AHTOPSLEAD.Text,
            'Uploaded By':AHTUploadeBy.Text
         }
      );
      RemoveIf(
         colWhosWho,
         ID=AHT.ID
      )
   )
);
Notify("All records has been submitted successfully!",NotificationType.Success);
Set(gvReset,true);
Set(gvReset,false)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz 

 

Giving me an error

 

akbarmahfuzalam_0-1599257802278.png

 

@akbarmahfuzalam ,

What is the error and where is it?

I have test run the syntax here and it it correct. You need to make sure all your field names are correct in both the gallery and list.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz 

 

I have double-checked the Syntax even though when applying the given code it fetching me an error.

 

 

akbarmahfuzalam_0-1599479943056.png

Note: This function IsBlank has some invalid arguments.

If you could see on the left-hand side the name of the level which I have used inside the Gallery.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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