Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

PowerApps Portals Multiselect Plugin Deletes Webpage Content

(0) ShareShare
ReportReport
Posted on by 50

Hi community

I applied the first part of Nick Hayduck's post to achieve the multiselect-option-set and got that working fine.

Nick Hayduck's post for reference: https://www.engineeredcode.com/blog/powerapps-portals-multiselect-option-set


Then when I applied the second part to add the plugin to read the selected data back to the original multi-select field, it totally removed all content (Columns and the Entity-Form) from the webpage. I added the Content and Entity-Form back, but now all the 'advanced steps' are ignored. I now see all form tabs loaded at the same time.

 

Any suggestions on how I can rollback to a previously good version or fix this issue?

 

Many thanks in advance.

  • DylanR Profile Picture
    50 on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    Hi @OliverRodrigues 

    No I did not. Thanks for the suggestion.

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    did you register your plugin via Plugin Registration Tool: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/tutorial-write-plug-in ?

     

  • DylanR Profile Picture
    50 on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    Hi @OliverRodrigues 

    Thank you for the feedback. I will change the plugin parameter back to 'Target'.

     

    Here are my steps I'm following to add the plugin. Note that I haven't actually 'saved' any of the pages yet....just wanting your input first that I'm doing it correctly.

     

    Step 1: Create the Web File record with the Partial URL 

    DylanR_0-1630038121857.png

     

    Step 2: Upload the .JS file to the Notes (renamed the file to .ES)

    DylanR_2-1630038740248.png

     

    Step 3: Add JS reference in the Copy HTML within the Web Page (content page)

    Note that I get to the 'content page' by opening the main 'Web Page' and then opening the child 'Localized Content' record...is this correct?

    DylanR_3-1630038825579.png

     

    I did these steps in the past and when opening the Portal, the page content had been deleted.

    Have I missed anything?

     

    One further note on the adjusted 'multiselect field'. The same field is applied multiple times on different tabs as it is common to multiple 'Advanced Steps'. Is this an issue?

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    Hi @DylanR I can see only one thing wrong in the Plugin, and that is the Target 

     

    Basically Target is an input parameter default for any Plugin, and you shouldn't change that one to Opportunity, you can keep it as target

    For more info: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/understand-the-data-context#parametercollections

     

    Regardless, I still think it's very weird that it deleted a web page, this part makes no sense, as you have no delete operation in your Plugin

     

    Can you also share snapshots of the Plugin Registration when you are publishing your Plugin/Step?

  • DylanR Profile Picture
    50 on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    Hi @OliverRodrigues 

    Have you had a chance to review my input above? I'm weary of applying the plugin and have the page deleted again. 

  • DylanR Profile Picture
    50 on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    Hi @OliverRodrigues 

    Thanks for your reply.

     

    This is the original script from Nick's post. I highlight the elements that I changed to my references.

    DylanR_0-1629441154236.png

     

    This is my script.

     

    public void Execute(IServiceProvider serviceProvider)
    {
    	var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
    
    	var entity = context.InputParameters["Opportunity"] as Entity;
    
    	if (entity.Attributes.ContainsKey("new_myTextField"))
    	{
    		OptionSetValueCollection strategy = new OptionSetValueCollection();
    		foreach (var option in entity.GetAttributeValue("new_myTextField").Split(','))
    		{
    			strategy.Add(new OptionSetValue(int.Parse(option)));
    		}
    
    		entity["new_myMultiSelectField"] = strategy;
    	}
     else if (entity.Attributes.ContainsKey("new_myMultiSelectField"))
     {
     entity["new_myTextField"] = string.Join(",", entity.GetAttributeValue("new_myMultiSelectField").Select(o => o.Value.ToString()));
     }
    }

     

     

    I then added the .js file as a Plugin following the steps in your blog post:

    https://oliverrodrigues365.com/2020/04/15/power-apps-portals-adding-field-mask/

    Note that I did change the file extension to .es as suggested.

     

    Then I applied the JS library reference on the Web Page as per the blog steps.

     

    When viewing the form, the entire middle section was deleted (everything between the header and footer). Did I perhaps miss a step or is the above code wrong?

     

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: PowerApps Portals Multiselect Plugin Deletes Webpage Content

    hi Dylan.. can you share the code of your plugin? 

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35