How to remove URL parameters.(Power Automate Desktop)

08/07/2023

Japanese version.

Here is how to remove the GET parameter from the URL.

This is the reverse of "How to leave only the GET parameter from the URL".

Overall view of Flow

Robin(for copy and paste)

It can be copied and pasted into Power Automate Desktop.

SET Url TO $'''https://www.samurai-emblem.com/?test=value'''
Text.ParseText.ParseForFirstOccurrence Text: Url TextToFind: $'''?''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> Position
IF Position >= 0 THEN
    Text.GetSubtext.GetSubtextFromStartTo Text: Url NumberOfChars: Position Subtext=> Subtext
END

Steps

URL parameters begin with "? and therefore use that rule.

First, use the Parse text Action to locate the "? Find the location of the ?

ParameterValue
Text to parseURL to delete parameter.
Text to find?
Is regular expressionOFF
Starting parsing as position0
First occurrence only ON

Next, place an If to control the URL parameter (?) to prevent errors if the URL parameter(?) is not present.

This is not necessary in cases where the URL parameter(?) is not necessary in cases where the URL parameter(?) is always present.

ParameterValue
First operand%Position%
OperatorGreater than or equal to(>=)
Second operand0

Place Get Subtext in If.

ParameterValue
Original textURL to delete parameter.
Start indexStart of text
LengthNumber of chars
Number of chars%Position%

When this flow is executed, the generated variable (%Subtext%) in the Get subtext Action parameter is set to the URL from which the parameter was removed.

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Tips(Power Automate Desktop)