How to Convert a Number to Hexadecimal in Power Automate?

Do you want to convert a number to hexadecimal in Power Automate? In this Power Automate tutorial, we will see how to convert numbers to hexadecimal in Power Automate.

Here, we will cover the topics below:

  • Convert numbers to hexadecimal in Power Automate Format number action.
  • Convert numbers to hexadecimal in Power Automate formatNumber()

Convert numbers to hexadecimal in Power Automate using the Format number action

Here, we will see how to convert the number to hexadecimal using the Format number action in Power Automate.

Example 1

For example, I have the number 123456 and want to convert it to hexadecimal, i.e., 1E240; for this, we will use the format X0.

1. In Power Automate Cloud, select the + Create button and then select Instant Cloud flow.

Microsoft Power Automate convert number to hexadecimal

2. Now provide the flow name and select the “Manually trigger a flow” action. Then click on Create.

How to convert number to hexadecimal using Microsoft Power Automate

Now, you can see the “Manually trigger a flow” action is added to the flow.

How to convert number to hexadecimal using Power Automate

3. Now, we will format a number into hexadecimal. For this, click on the +New step -> select Format number action. Then provide the below information:

  • Number: Provide the number to convert hexadecimal
  • Format: Provide the format as X0
Power Automate convert number to hexadecimal

4. Now save and run the flow manually; you can see the output as hexadecimal.

Convert number to hexadecimal Power Automate

Example 2

For example, I have the number 123456, and I want to convert it to hexadecimal, i.e., 1e240; for this, we will use the format x0.

See also  Power Automate desktop concatenate strings

1. In this case, we will change the format; for this, expand the formatNumber action and then change the format to x0.

convert number to hexadecimal using Power Automate

2. Now run the flow manually, and you can see the output as hexadecimal.

Convert number to hexadecimal Power Automate

This is how to convert any number into a hexadecimal format in Power Automate flow using the Format number action.

Convert numbers to hexadecimal in Power Automate formatNumber()

Here, we will see how to convert numbers to hexadecimal in Power Automate formatNumber().

Example 1

For example, I have the number 123457, and I want to convert it to hexadecimal, i.e. 1E241; for this, we will use the format X0.

1. In Power Automate Cloud, select the +Create button and then select Instant Cloud flow.

Microsoft Power Automate convert number to hexadecimal

2. Now provide the flow name and select the “Manually trigger a flow” action. Then click on Create.

How to convert number to hexadecimal using  Power Automate

Now, you can see that the “Manually trigger a flow” action is added.

How to convert number to hexadecimal using Power Automate

3. Now, we will format a number into hexadecimal. For this, click on the +New step -> select Compose action. Then provide the below information:

  • Inputs: Provide the below expression:
formatNumber(123457, 'X')
convert number to hexadecimal Power Automate

4. Now run the flow manually, and you can see the output as hexadecimal in Power Automate.

convert number to hexadecimal in Power Automate

Example 2

For example, I have the number 123457 and want to convert it to hexadecimal, i.e., 1e241; for this, we will use the format x0.

1. In this case, we will change the expression in the Compose action, so expand the Compose action and then provide the below information

  • Inputs: Provide the below expression
formatNumber(123457, 'x')
Power Automate convert number to hexadecimal

2. Now save and run the flow manually, and you can see the output as hexadecimal.

convert number to hexadecimal Microsoft Power Automate

This is how to format the number to hexadecimal using the Power Automate formatNumber function.

See also  format number in Power Automate

Conclusion

In this Power Automate tutorial, we saw how to convert a number to hexadecimal using Power Automate.

You may also like:

>