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.
No I did not. Thanks for the suggestion.
did you register your plugin via Plugin Registration Tool: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/tutorial-write-plug-in ?
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
Step 2: Upload the .JS file to the Notes (renamed the file to .ES)
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?
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?
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?
Have you had a chance to review my input above? I'm weary of applying the plugin and have the page deleted again.
Thanks for your reply.
This is the original script from Nick's post. I highlight the elements that I changed to my references.
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?
hi Dylan.. can you share the code of your plugin?
Lucas001
60
Super User 2025 Season 1
Fubar
55
Super User 2025 Season 1
surya narayanan
35