Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to update fields after insert from url

Featured Replies

Hi There,

 

I'm trying to post data to a url which will then be imported to a web based application through an API.

 

I'm struggling to get this going using the insert from URL script step and using the following format for the URL:

 

httppost://myurl.com/post?sku=Products::sku&handle=Products::handle

 

Has anyone implemented this before and if so could you advise if I'm using the correct syntax for posting data to a URL?

 

Mark. 

 

 

httppost://myurl.com/post?sku=Products::sku&handle=Products::handle

 

 

 

Should be something more like:

 

"httppost://myurl.com/post?sku=" & Products::sku & "&handle=" & Products::handle

 

It is a mix of literal string and values from fields.

  • Author

Thanks for the feedback Wim

 

I made the changes to the insert url script step but I'm still getting error 3

 

At the moment it's a super simple script as I'm just trying to get the post part working.

 

Here's the script:

 

Go To Layout ["Product Details (Products)]

Insert from URL ["httppost://myurl.com/addproducts.php?sku=" & Products::sku & "&handle=" & Products::handle]

 

Last Error is error 3

 

Is there something I'm missing? All I'm trying to do is post the data to a URL so I can't see that I need anything else. the filemaker help doesn't go into much depth on this.

 

Mark

  • Author

Ok I experimented some more and it seems that a field must be selected even though I wasn't after a response. 

 

Not getting error 3 anymore - new error but sorting that one out.

Well; that is what "insert…" means isn't it?

 

Insert into what?

 

Into the field you have selected in this script step; or into the field already selected by a script step or user action.

Which, in turn, also implies that the field you are inserting into must be on the layout, and must be a valid field for the current context.

  • Author

Thanks Bruce,

 

I was doing research on posting FM records using FM - and what I found only reference using insert from URL as a posting method - wasn't aware it required a response to be inserted into a field as mandatory.

 

I think I just expected the FM would have a way to post data to a URL natively on it's own, A bit like an export feature but posting to a URL.

 

Either way, Thank you both for your feedback, It's set me on the right track now.

Filemaker does not have a HTTP POST method as such. You can post data as part of the Insert From URL[] and Import Records[] script steps. If you are not importing the response as records, then Insert From URL[] would make a better choice - and channeling the response to a field is good practice anyway, as it allows you to handle errors.

  • 3 weeks later...
  • Author

Thank you for your input.

 

I finally got this up and running. 

 

I'm able to post the data that I want to our web based POS system.

 

Now I'm trying to figure out how to handle the response. Will post a new topic to cover that though.

  • Author

Hi there,

 

Wondering if anyone could provide a little guidance for me.

 

We are posting product data from filemaker to a web based pos system, (through a custom API connector we created) and then receiving a response.

 

This response contains full product data from the pos system.

 

What I'm trying to achieve is that I update a number of fields in my filemaker record with selected data from the response.

 

I'm trying to figure out if this can be handled through XML ie. we can configure the response to be any any format we like. So if we inserted the response as filemaker xml could I then update certain fields with that?

 

I can't seem to find a way to interpret the xml when using "Insert from url" though.

 

Would appreciate it if anyone has any suggestions or pointers to guide me.

 

Mark 

I merged your two topics, they are about the same need. Please do not create a new topic when working on the same need.

  • Author

Thanks comment.

I'm trying to get my head around which way to do this now.

What I'm trying to do at the moment is create a new product in our pos system using an existing product in filemaker.

I'm posting the data from this new product record using 'insert from url' - that part is working.

The response I get back contains 4 values that I want to use to update 4 different fields in filemaker

What I'm trying to work out is the best way to format the response in order to update the fields.

I'm not sure whether using import will achieve what I'm after since I will only ever be doing this process on one single record at a time.m( the pos can only update a single record at a time)

I was thinking of formatting the response as a list then just extracting the values, but I was concerned that I wouldn't be able to easily check for errors.

I thought using xml and matching field names would cover some possible errors.

The response I get back contains 4 values that I want to use to update 4 different fields in filemaker

 

Assuming that's 4 fields in the current record, and that the record is either the only record in the found set or that there is a matching value in the response, I would still go with using Import Records[]. Parsing XML by hand, using text functions, is not something I would willingly undertake.

  • Author

Got you. Basically using a script to find the current record, do an import, doing the http post as part of the import and parsing the response through a xml style sheet to update fields in the current record.

That makes sense. I get to work implementing that and see how it goes.

Thank you comment.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.