Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Design & Build
Suggested answer

Showing/Hiding Sections Based on Previous Step of Multi-Step Form

(1) ShareShare
ReportReport
Posted on by
Hi
I've run into an issue building my first site that I need some advice on.  The site uses a multi step form where towards the end of the steps the form need to show or hide sections of the page that inform the user what evidence (files) they need to upload based on a series of questions completed earlier on in the steps.  Quite a few of these sections will need to be shown/hidden based on multi choice fields & some of these are contained on a form step that uses a grid where there can be several records per applicant. There are two tables in the dataverse used by the website, one for the applicant details and another that stores details on other member of their household in a one to many relationship.   I've been able to show & hide fields where they exist on the same form as well as sections with a bit of basic javascript that I've used for the first time.  However, how can I access data on a multistep form where the data is from a previous step and potentially in a multi choice field (not all) where there can be multiple records per user in some cases?  Would appreciate it if someone could recommend a best approach for dealing with this even if it is a sub optimal workaround!
Cheers
 
Categories:
  • Suggested answer
    Fubar Profile Picture
    7,762 Super User 2025 Season 1 on at
    Showing/Hiding Sections Based on Previous Step of Multi-Step Form
    First point to make is that you are not accessing data on the Form Steps themselves, unless you are currently on a Step and are accessing that Steps values via JavaScript - You are accessing Dataverse data.
     
    To access dataverse data you have options such as using:
    • Portals Web API
    • Power Pages Flow
    • Liquid e.g. fetchxml (not so great for a multistep form)
    • Depending on what you need, another option is to include the info you need but hide it using CSS
    For data on the main record that your final step is for I would probably include it on the form as readonly, with no label and then using  Form/Step Metadata records hide each attribute with  a CSS class (doing it in metadata will stop any screen flicker etc that you may get if you do it in JavaScript, metadata will not hide the label hence set it to not display the label on the dataverse form).
     
    For items that may be in Subgrids, would consider querying using Portals Web API or a Power Pages Flow (both are initiated by JavaScript Ajax call, microsoft provide safeAjax wrapper code for the Web API), but would also see if there was a way I could update the main record on create/update of items in the subgrid e.g. a Realtime Dataverse Workflow or plugin that updates the parent record to the item in the subgrid (to make it easier and quicker to do stuff on the last step).
     
    Portals Web API
     
    Power Pages Flow
     
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,681 Most Valuable Professional

Leaderboard

Featured topics