DELETE multy attachments
let method := "DELETE";
 let rid := text(this);
 let teamid := first(select Settings).DatabaseTeam;
 let dbid := first(select Settings).DatabaseID;
 let tid := tableId(this);
 let file := urlEncode(text(fileMetadata(this, last(split(text(item(files(this), 0)), "/"))).name));
 let cont := "application/json";
 let url := ---
 https://api.ninox.com/v1/teams/{ teamid }/databases/{ dbid }/tables/{ tid }/records/{ rid }/files/{ file } 
     ---;
 let bear := "Bearer " + first(select Settings).'API-Key';
 let response := do as server
         http(method, url, {
             Authorization: bear,
             'Content-Type': cont
         }, {})
     end;
 if response.error then
     alert(text(response.error))
 end
i have this code for delete one to one attachment .
Sameone can help me for change this code for delete all attachments in one step
thanks
6 replies
- 
  Have a look here https://forum.ninox.com/t/y4yymy7/workspace-not-being-recovered-where-images-are-held-deleted therr are various options including delete all attachments to a table record 
- 
  great!!! i finded the solution ...... thks 
- 
  Can you mark post as aswered please 
- 
  The clause: let bear := "Bearer " + first(select Settings).'API-Key'; Returns the error Unknown table 'Settings'. I don't find what's wrong with this. 
- 
  Oscar its the location where you put your API string ref in the case above there is a table called settings you need to change this to be the table name of where your API setting is. 
Content aside
- 9 mths agoLast active
- 6Replies
- 147Views
- 
    3
    Following
    
