cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lucas_Ignatius
Helper IV
Helper IV

Save Gallery and Form PowerApps into SharePoint List

Hi everyone, I just want to save my powerapps gallery data to SharePoint List but there is only one column (only title) if I add other column it will be an error.

Can anyone help me

 

I attach my screenshoot bellow

Save Gallery to List SharePoint.JPG

 

My command : ForAll(ExpenseCollection,Patch('Budget Tracking',Defaults('Budget Tracking'), {Title:Title, NominalBiaya:Amount,}));

The problem if I add NominalBiaya:Amount it can't save but if only title:title it will be save to my sharepoint

 

And then I want to save my other column Department (dropdown2 it from my database sharepoint list) into my SharePoint List but it can't save 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Lucas_Ignatius ,

What type of field is Amount in ExpenseCollection ? If is is Numeric, why does this not work?

ForAll(
   ExpenseCollection As aExpense, 
   Patch(
      'Budget Tracking',
      Defaults('Budget Tracking'),
      {
         Title:aExpense.Title, 
         NominalBiaya:aExpense.Amount
      }
   )
)

 

If it is not a field (you simply have the Amount Text box in the gallery), then you have to refer to that (which as you said works.

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.

View solution in original post

12 REPLIES 12
Boynog
Helper II
Helper II

Hi @Lucas_Ignatius ,

Use this code below.

ForAll(ExpenseCollection,Patch('Budget Tracking',Defaults('Budget Tracking'), {Title:Title.Text, NominalBiaya:Value(Amount.Text)}));

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Lucas_Ignatius_0-1617258098554.png

 

It still have an error.

@Lucas_Ignatius ,

Use this only.  If you want to save a single row. 

Patch('Budget Tracking',Defaults('Budget Tracking'),{Title:Title.Text, NominalBiaya:Value(Amount.Text)});

 

Then can you highlight the error.

 

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 

@Lucas_Ignatius ,

 Just make sure no space

Patch('Budget Tracking',Defaults('Budget Tracking'),{Title:Title.Text,NominalBiaya:Value(Amount.Text)});

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Yap, it works but only saved amount only first row on column nominalbiaya.

Lucas_Ignatius_0-1617260368473.png

Lucas_Ignatius_1-1617260415488.png

 

@Lucas_Ignatius ,

 

Patch('Budget Tracking',Defaults('Budget Tracking'),{Tahun:Title.Text,Department:DropdownDepartment.Selected.Value,NominalBiaya:Value(Amount.Text),SisaBudget:SisaBudget.Text});

 

put the names of your components just follow the format

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

  

ForAll(ExpenseCollection, Patch('Budget Tracking',Defaults('Budget Tracking'),{Title:Title, NominalBiaya:Value(Amount.Text)}));

 

I just add ForAll, but it still only one row on NominalBiaya if save to sharepoint list, and for Title is correct will be save all column 

@Lucas_Ignatius ,

You need to disambiguate Title

ForAll(
   ExpenseCollection As aExpense, 
   Patch(
      'Budget Tracking',
      Defaults('Budget Tracking'),
      {
         Title:aExpense.Title, 
         NominalBiaya:Value(Amount.Text)
      }
   )
)

I am assuming here that Amount.Text is always the same value for each item (and is not in the Expense Collection).

If not (it is in the Collection), you need

ForAll(
   ExpenseCollection As aExpense, 
   Patch(
      'Budget Tracking',
      Defaults('Budget Tracking'),
      {
         Title:aExpense.Title, 
         NominalBiaya:aExpense.Amount
      }
   )
)

 

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.

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

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 (2,969)