Parse text from large string

@Paul Newcome - I've read a lot of your discussions throughout the years and you are the MAN! I have a question down below and hoping you can walk me through it. I'm simply not that good at this particular formula design.

I have a SF Connector setup and it pulls the below string. The total character length of the string is seldom the same for each row that comes in. I'm trying to parse certain information from this string. I feel like if I can get the formula down, I'd be off to the races.

To start, I just need (for now) the SUBTOTAL (which in the case below should be 630. Basically I need to find the subtotal, and then parse out the value (630).


{"PurchaseOrder" : {"@timeStamp":"2021-12-29 12:44:28","Request":{"Payment":{"@method":"AB"},"OrderType":"NC","Detail":{"Totals":{"Total":"576.19","SubTotal":"630","Delivery":"0"},"Item":[{"VendorPack":"1","VendorID":"01234567","Units":"1","UnitPrice":"630.0","UnitOfMeasure":"EA","Taxable":"Y","Sku":"987654321","QuoteID":"Channel","Qty":"1","MerchClass":"635","ManufacturerPartNum":"01-00860-101","ManufacturerID":"000123456","ListPrice":"699.99","LineNumber":"1","Description":"XXXXX","CustomerLineNumber":"1","CostCenter":"","Cost":"576.19","CatalogPage":""}]},"Accounting":{"Release":"","PONumber":{"*body":"PO12345"},"Desktop":"","CostCenter":""}},"Header":{"ShipTo":{"Addr":{"@seq":"00003","Contact":{"PhoneNumber":{"Number":"(000) 000-0000"},"Name":"JOHN SMITH","Email":{"*body":"johnsmith@gmail.com"}}}},"ShipComplete":"N","Sender":"SalesForce","Returnable":"N","DropShip":"Y","CustomerID":"012345678","Comments":"No Comments","BillOnly":"N"},"@documentid":"a8t2S000001ZjHEQA0"}}

Best Answer

  • Paul H
    Paul H ✭✭✭✭✭✭
    edited 01/19/22 Answer ✓

    Sorry my mistake the 160 shouldn't have been there it should have been start@row

    Nested =MID(Text@row, FIND("SubTotal", Text@row, 1) + 11, FIND(CHAR(34), Text@row, FIND("SubTotal", Text@row, 1) + 11) - (FIND("SubTotal", Text@row, 1) + 11))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!