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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Variable creation powe...
Power Pages
Answered

Variable creation powerpages

(0) ShareShare
ReportReport
Posted on by 30

I have two pages.. I want to send first first page primary key to second page form..

Can i store this field in to a variable..

Can we create a variable in power pages?

 

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    It depends on what you are doing on the first Page e.g. if you are creating or editing a record using a Basic Form, on submit of that form you can configure it to redirect to the next page and send the internal guid of the record you were creating/working with (https://learn.microsoft.com/en-us/power-pages/configure/basic-forms#on-success-settings) not sure if it is all exposed in the Designer (if not you use the Portal/Power Pages Management App).

  • rpaa Profile Picture
    30 on at

    in the first page .. i have a basic form that taken employee details from users..the primary key of the first table is an autonumber..

     

    in the second page i have another basic form which related to another table for storing the certifictes and different types of employees documents..

     

    i need the primary key of first table for setting the documents in the second form..

     

     

     

     

     

  • Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    In Dataverse the true Primary Key is a system generated GUID.  I am assuming you are getting this confused with the Primary Column which is not the Primary Key (and there is no uniqueness constraint on it), Primary Column is the column that is displayed to the user when they see a Lookup field to the master table (i.e. they see the value in the Primary Column not the GUID even though it is the GUID that links the 2 records).

    Technically you can pass a text field (autonumber is a text field) but you can't 'link' any thing with it - you want the records GUID to be able to link.

     

    It would help if you could include a data model/ERD of the Tables in question.

     

    Do you have Employee Details 1-to-many Employee Documents, if so:

    • have you considered using a Multistep form, first Step Employee Details, 2nd Step Employee Details with a Subgrid to Employee Documents).
    • Similarly, if using Basic Forms, your 1st Page would be Employee Details redirecting with Append Record ID To Query String; your 2nd Page would be Employee Details with a Subgrid for Employee Documents with the Basic Form configured to receive (Record Source Type) the Record ID from the 1st Page 

    (you would use different Tabs or forms for entering employee details vs the subgrid.  And to create/edit the subgrid records Basic Forms based on that table)

  • rpaa Profile Picture
    30 on at

    Thank you for your replay..

     

    can you just explain me this..actually i am beginner in power pages

     

    • Similarly, if using Basic Forms, your 1st Page would be Employee Details redirecting with Append Record ID To Query String; your 2nd Page would be Employee Details with a Subgrid for Employee Documents with the Basic Form configured to receive (Record Source Type) the Record ID from the 1st Page 
  • Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    So if you need multiple documents for 1 Employee, you would usually achieve this by having your Dataverse form have the Employee details fields, and a Subgrid on that form for the documents.

     

    Given the above, for Power Pages (and because subgrids don't render until after the record is created). You may choose to have 2 Tabs on your Dataverse form (1 for Employee Details, the other with the Subgrid).

    You then create 2 Basic forms (1 for each Dataverse Form Tab, or 1 for each Dataverse form depending on how you approached it) - note: the Site Designer has less options than Portal/Power Pages Management App and will default to showing the whole Dataverse Form (not specific Tabs).

    For your Basic Forms, there are settings for Redirecting On Success (i.e. record saved, go to a different page), and also for receiving the ID (GUID) of the record for the Basic Form to  start with (Record Source Type on the page but above where the link I posted earlier is to).  So you basicaly configure 1 Basic Form to send the ID, and the other Basic Form to receive that ID (by default the system usually uses the paramter 'id' but you can use a different name, you just need to set the same value in both the redirect/send and query string paramter).

    If you get that working, you will create on Page 1, load Page 2 and see the Subgrid (but you then need further configuration to allow create and edit of items in the subgrid - this can be done by adding a metadata record to the Basic Form that has the Subgrid on it, and setting its Type to Subgrid https://learn.microsoft.com/en-us/power-pages/configure/configure-basic-form-metadata#basic-form-metadata-properties)

    Also, if you search online you will find Videos etc showing how to do it.

     

  • rpaa Profile Picture
    30 on at

    I created the subgrid for adding multiple documents ...but there is no add button(+)

     

    I can't add the documents..is there any neccessary thing i need enable?

     

    rpaa_0-1715142736350.png

     

  • Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    If not done already, create a Basic Form (insert) for the Table of the records in the Subgrid.

     

    For the Basic Form that has the Subgrid, you need to add a Basic Form Metadata record - set its type to Subgrid and then select the subgrid in question, this will then enable the grid where you can add Create /Edit forms

     

    Fubar_1-1715143390385.png

     

     

    Fubar_0-1715143325619.png

    After you click the create/edit buttons above you will be presented with an area for the Basic Form (or web page) to use for that action.

     

    And then also make sure the Portal User is getting a Table Permission (added to a Web Role the user is using) that gives them read, create, edit, append, append to.  (without the table permission you also will not see the Create button etc)

     

  • rpaa Profile Picture
    30 on at

    Thank you for your support..

     

    but i can't see the subgrid in my preview..it shows only the section name..nothing else

     

    rpaa_0-1715146154048.png

     

  • rpaa Profile Picture
    30 on at

    Thank you...almost done..i was able to add subgrid in the page and create button also..

     

    can i add multistep form here..instead of basic form..

    I need to add attachment field..i think it won't shows  in basic forms..

    thats why i am asking

    rpaa_0-1715246865389.png

     

  • Verified answer
    Fubar Profile Picture
    8,491 Super User 2026 Season 1 on at

    You can change the Target Type to Web Page and then have a multi step on the Web Page.  The difference with using Web Page, is it is not a popup.

     

    Also, both Subgrids and File fields will not work on an Insert form (but will on an edit/read form). You can however configure File upload on an Insert form, where you use Notes instead of a File field - there is are settings on the Basic Form to enable Notes file attachment (and also metadata, but the setting on the Basic form is what works for insert), for this to work your Dataverse Table must also be configured for Notes.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 59

#2
11manish Profile Picture

11manish 53

#3
Vish WR Profile Picture

Vish WR 29

Last 30 days Overall leaderboard