cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
relleK
Regular Visitor

Output to Google Sheets refuses to be number (Integer), always stuck as text.

Hello,

 

I've tried several different approaches to get this flow to send output to google sheets NOT as text. No matter what I try, the flow generates the output as text before it sends even though it's definitely calculated as an integer.

 

I don't see how it can be anything wrong with the way the flow is set.

 

Here is the RAW input/output:

 

Untitled.png

I've tried:

  • Initialize blank Variable as Integer -> Set Variable as: int(outputs('Get_a_row')?['body/WEST DOCK'])
  • Initialize Variable directly to integer with: int(outputs('Get_a_row')?['body/WEST DOCK'])
  • Adding directly to the Update row block several different ways
    • As an Outputs
    • as a Variable
    • as an add()
    • as a mul()
      • ALL of these produce the desired results as you can see in the RAW input/output

So, why is it when the output gets posted, it's back to a string inside quotation marks?

 

The sheet:

 

2.png

 

Can anyone please tell me what I'm missing here?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support
5 REPLIES 5
v-xiaochen-msft
Community Support
Community Support

Ahammad_Riyaz
Super User
Super User

Hi @relleK 

 

Please refer this.

https://powerusers.microsoft.com/t5/General-Power-Automate/Convert-text-to-number/td-p/40748

 

int(outputs('Compose'))

 

Regards

Ahammad Riyaz

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

@Ahammad_RiyazI Tried this approach already. The output is always the same, even when the input is an integer.

@v-xiaochen-msftThank you, It's not a solution, but it is an answer. Glad I gave up on trying to get it to work! 😂

For the record in case someone else finds there way here:

 

Create an Apps Script in Google Sheets, with a trigger Event Type to run after any "Change." Setting this to "On Edit" did not trigger the script to run.

 

Here is the script I used. Just adjust the number format however you need it, and you could even break this down by the cell in case you need different formats. After adding and deploying this, as soon as PA sends the data, the script gets rid of the 'tick.'

 

function myFunction() {
  
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

// Select Range
var column = sheet.getRange("C2:J53");

// Set Format
column.setNumberFormat("0");
}

 

relleK_1-1649863742463.png

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,013)