web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filling a SharePoint o...
Power Apps
Unanswered

Filling a SharePoint online list by clicking buttons

(0) ShareShare
ReportReport
Posted on by 4

Hello,

 

I have set up a SharePoint online list with multiple columns. Now I want to make an app using PowerApps to write data to these columns. But not in traditional forms, but by navigating through screens and pressing buttons.

 

The situation:

SharePoint list columns: Cabin; Material; Type; Color (there is actually a bunch more, but for reference this is enough)

Screen 1: 3 buttons labelled: "Cabin 1", "Cabin 2" and "Cabin 3"

Screen 2: 4 buttons labelled: "Wood", "Metal", "Concrete" and "Brick and mortar"

Screen 3: 3 buttons labelled: "ABv6", "mBvK1" and "mBvK2"

Screen 4: 5 buttons labelled: "Yellow", "White", "Black", "Blue" and "Red" 

 

I want to navigate through the screens by clicking these buttons, and on click (or final click) also store data to SharePoint.

 

So on button "Cabin 1" I want OnSelect:Navigate(Screen2;None;{Cabin:button1_1.Text}), and I also figured out how to use the Patch command in the last screen to save all data to SharePoint. what I can't figure out is inbetween the first and last screen. How do I hand over the value for variable Cabin (which is from screen 1) from Screen 2 to Screen 3? And so on untill the last screen (which is Screen 22).

 

Any help is greatly appreciated!

Categories:
I have the same question (0)
  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    May I explain?

     

    As Navigate(,,,,,, {Cabin: button1_1.Text}) generate a context variable "Cabin", this will be treated as a "Global Variable" and will continue to hold the value of button1_1.Text until you make the next change.

     

    FYI, UpdateContext({Cabin: button1_1.Text}) will generate the Cabin context variable for that particular screen ONLY.

     

    Hope this clarified your doubts if I understand your question.

    TQ

     

  • v-micsh-msft Profile Picture
    on at

    Hi @PhilipK,

     

    Could we create a collection with the same strucutre of the SharePoint list, then save the selected data into this collection, and finally, submit the data within the collection to the data source?

    To get the structure, we could try with the following under the onselect property of the Buttons under screen1:

    Collect(HoldData, SharePointList);clear(HoldData);Patch(HoldData, defaults(HoldData), {Cabin:Button1_1.text});Navigate(....)

    This would generate a single record in the collection, in other screen, when need to save data, we could take use of the function below with the onselect property of the button:

    patch(HoldData, first(HoldData), {FieldName:Button.text});Navigate(....)

    Then on final screen, the onselect property of the button should be:

    patch(SharePointList, defaults(SharePointList), {Cabin:first(HoldData).Cabin,....})

    Regards,

    Michael

  • PhilipK Profile Picture
    4 on at

    Hi @hpkeong

     

    I understand what you're saying, but I see PowerApps work in a different way. I will try to explain:

     

    Consider the following flow through the app:

    Press "Start registration" > Load screen 2 > press "Cabin 1" > Load screen 3 > press "ABv5" > Load screen 4 > press "Blue"

     

    When I use the following code for button "Cabin 1" OnSelect: Navigate(Screen3;None;{VarCabin:buttonCabin1.Text}), I am able to use the variable VarCabin on screen 3.

    Then I use the following code for "ABv5" Onselect: Navigate(Screen4;None:{VarType:ABv5.Text}). When I come to screen 4, I am able to use the variable VarType, but I am not able to use variable VarCabin.

     

    Am I doing something wrong?

     

  • PhilipK Profile Picture
    4 on at

    Hi @v-micsh-msft,

     

    Thank you for your response. This is a new technique to me. I will try this and let you know if and when I make any progress.

     

    Regards Philip

  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    I have tried and tested and in fact, Navigate only brong over variable for that screen only.

    My apologies.

     

    So, please modify as following:

     

    Screen1:

    Button1.Onselect: 

    Navigate(Screen3, ScreenTransition.None); ClearCollect(MyVarCabin, {VarCabin: Button1.Text})

    Screen3:

    Button1_1.OnSelect:

    Navigate(Screen4, ScreenTransition.None); ClearCollect(MyVarType, {VarType: Button1_1.Text})

     

    Screen4:

    I insert:

    Label1.Text = First(MyVarCabin).VarCabin

    Label1_1.Text = First(MyVarType).VarType

     

    If you look at the Collections (in PowerApps Studio -> View -> Collections),

    you can see two Collectiosn are created (Table).

     

    So, Order to show in Label, I use:

    - First(Table).Var

     

    Or you may use ListBox, Gallery, etc. to hold table to view.

     

    Hope this helps.

     

    TQ

     

    NB

    Navigate( Screen, Transition [, UpdateContextRecord ] )

    - My mistae when first recommend this as it also generate local variable. It reminds me of my misunderstanding, too.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard